{extend name="layout" /}
{block name="head"}
<style>
    html{background: #FFF;}
</style>
{/block}
{block name="page"}
    <form class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label">角色</label>
            <div class="layui-input-inline">
                <select name="role_id">
                    {volist name="role" id="v"}
                    <option value="{$v.id}" {eq name="data.role_id" value="$v.id"}selected{/eq}>{$v.name}</option>
                    {/volist}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-block">
                <input type="text" name="username" value="{$data.username}" disabled required  lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input layui-disabled">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">密码</label>
            <div class="layui-input-block">
                <input type="password" name="password" placeholder="请输入密码,不修改可以不输入" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">确认密码</label>
            <div class="layui-input-block">
                <input type="password" name="password_confirm" placeholder="请确认密码" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">姓名</label>
            <div class="layui-input-block">
                <input type="text" name="name" value="{$data.name}" required  lay-verify="required" placeholder="请输入姓名" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">手机</label>
            <div class="layui-input-block">
                <input type="text" name="mobile" value="{$data.mobile}" required  lay-verify="phone" placeholder="请输入手机" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="radio" name="lock" value="0" title="正常" {eq name="data.lock" value="0"}checked{/eq}>
                <input type="radio" name="lock" value="1" title="锁定" {eq name="data.lock" value="1"}checked{/eq}>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态备注</label>
            <div class="layui-input-block">
                <input type="text" name="lock_msg" value="{$data.lock_msg}" placeholder="请输入状态备注,当状态为锁定时有效" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"></label>
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="dosub">提 交</button>
            </div>
        </div>
    </form>
{/block}
{block name="js"}
<script>
    layui.config({
        base: '__STATIC__/js/'
    }).use(['app'], function () {
        var app=layui.app;
        var $ = layui.$;
        var form = layui.form;
        form.on('submit(dosub)', function (data) {
            app.post(data.field, 1);
            return false;
        });
    });
</script>
{/block}